package com.devinlee.designpatterns.observer;

import com.devinlee.designpatterns.observer.consumer.Customer;

/**
 * 观察者模式-测试
 * <p>
 * Created by devinlee in 2022.07.04
 */
public class Demo {

    public static void main(String[] args) {

        Shop shop = new Shop();
        shop.addGoods("猪肉", 168);

        Customer zhangsan = new Customer("zhangsan");
        Customer lisi = new Customer("lisi");

        shop.subscribe("618", zhangsan);
        shop.subscribe("双11", zhangsan);
        shop.subscribe("618", lisi);
        shop.start11();
        shop.start618();
    }
}
